<div class="contents">
  <form class="form-horizontal" role="form" name="form" novalidate>  
  <div ng-if="role=='qd'||role=='qdm'">
    <div ng-if="!booleanInsert" class="form-group">
      <label>订单预约成功后才可以申请合同</label>
    </div> 
    <!--申请合同 -->
    <div ng-if="!item.id&&booleanInsert" class="form-group" ng-class="{'has-error':form.receiveName.$invalid}">
      <label class="col-sm-2 control-label">收件姓名</label>
      <div class="col-sm-5">
        <input type="text" required="required" class="form-control" placeholder="收件姓名" name="receiveName" ng-model="item.receiveName" >
      </div>
    </div> 

    <div ng-if="!item.id&&booleanInsert" class="form-group" ng-class="{'has-error':form.receivePhone.$invalid}">
      <label class="col-sm-2 control-label">电话</label>
      <div class="col-sm-5">
        <input type="text" maxlength="11" ng-pattern="/^\d{11}$/"   required="required" class="form-control" placeholder="电话" name="receivePhone" ng-model="item.receivePhone" >
      </div>
    </div> 

    <div ng-if="!item.id&&booleanInsert" class="form-group" ng-class="{'has-error':form.detailAddress.$invalid}">
      <label class="col-sm-2 control-label">地址</label>
      <div class="col-sm-5">
        <input type="text" required="required" class="form-control" placeholder="地址" name="detailAddress" ng-model="item.detailAddress" >
      </div>
    </div> 

    <div ng-if="!item.id&&booleanInsert" class="form-group" ng-class="{'has-error':form.remarks.$invalid}">
      <label class="col-sm-2 control-label">备注</label>
      <div class="col-sm-5">
        <input type="text" required="required" class="form-control" placeholder="备注" name="remarks" ng-model="item.remarks" >
      </div>
    </div> 

    <div ng-if="!item.id&&booleanInsert" class="form-group">
      <div class="col-sm-offset-2 col-sm-5">
        <button type="button" ng-click="save('02')" class="btn btn-default"  has-auth where="btn" >申请合同</button>
      </div>
    </div>

<!--已申请合同，等待寄出合同 -->
    <div ng-if="item.id&&booleanInsert" class="form-group" >
      <label class="col-sm-2 control-label">合同状态</label>
      <div class="col-sm-5" style="margin-top: 13px;">
        {{item.contractStatus | contractStatusRender}}
      </div>
    </div> 
    <div ng-if="item.id&&booleanInsert" class="form-group" >
      <label class="col-sm-2 control-label">收件姓名</label>
      <div class="col-sm-5" style="margin-top: 13px;">
        {{item.receiveName}}
      </div>
    </div> 
    <div ng-if="item.id&&booleanInsert" class="form-group" >
      <label class="col-sm-2 control-label">电话</label>
      <div class="col-sm-5" style="margin-top: 13px;">
        {{item.receivePhone}}
      </div>
    </div> 
    <div ng-if="item.id&&booleanInsert" class="form-group" >
      <label class="col-sm-2 control-label">地址</label>
      <div class="col-sm-5" style="margin-top: 13px;">
        {{item.detailAddress}}
      </div>
    </div> 

    <div ng-if="item.id&&booleanInsert" class="form-group" >
      <label class="col-sm-2 control-label">备注</label>
      <div class="col-sm-5" style="margin-top: 13px;">
        {{item.remarks}}
      </div>
    </div> 

    <div ng-if="item.id&&booleanInsert&&item.contractStatus>'02'" class="form-group" ng-class="{'has-error':form.contractCode.$invalid}">
      <label class="col-sm-2 control-label">寄出合同编号</label>
      <div class="col-sm-5" style="margin-top: 13px;">
       {{item.contractCode}}
      </div>
    </div> 
    <div ng-if="item.contractStatus=='03'" class="form-group">
      <div class="col-sm-offset-2 col-sm-5">
        <button type="button" ng-click="save('04')" class="btn btn-default"  has-auth where="btn" >寄出合同</button>
      </div>
    </div>
  </div>

<!-- 产品经理 和 产品总监显示表 -->
  <div ng-if="(role=='cp'||role=='cpm')&&!item.contractStatus">
    未申请合同
  </div>
  <div ng-if="(role=='cp'||role=='cpm')&&item.contractStatus"> 
    <div class="form-group" >
      <label class="col-sm-2 control-label">合同状态</label>
      <div class="col-sm-5" style="margin-top: 13px;">
        {{item.contractStatus | contractStatusRender}}
      </div>
    </div> 

    <div ng-if="item.contractStatus>'02'" class="form-group" >
      <label class="col-sm-2 control-label">寄出合同编号</label>
      <div class="col-sm-5" style="margin-top: 13px;">
        {{item.contractCode}}
      </div>
    </div> 

    <div ng-if="item.contractStatus=='02'" class="form-group" ng-class="{'has-error':form.contractCode.$invalid}">
      <label class="col-sm-2 control-label">寄出合同编号</label>
      <div class="col-sm-5" style="margin-top: 13px;">
        <input type="text" required="required" class="form-control" placeholder="合同编号" name="contractCode" ng-model="item.contractCode" >
      </div>
    </div> 

    <div ng-if="item.contractStatus=='04'" class="form-group" ng-class="{'has-error':form.contractBackCode.$invalid}">
      <label class="col-sm-2 control-label">收回合同编号</label>
      <div class="col-sm-5">
        <input type="text" required="required" class="form-control" placeholder="收回合同编号" name="contractBackCode" ng-model="item.contractBackCode" >
      </div>
    </div> 

     <div class="form-group"  ng-if="item.contractStatus>'04'">
      <label class="col-sm-2 control-label">收回合同编号</label>
      <div class="col-sm-5" style="margin-top: 13px;">
        {{item.contractBackCode}}
      </div>
    </div> 

    <div ng-if="item.id&&booleanInsert&&item.contractStatus>='04'" class="form-group" ng-class="{'has-error':form.contractCover.$invalid}">
      <label for="advertLinkInput" class="col-sm-2 control-label">
        合同封面
      </label>
      <div class="col-sm-5">
        <input type="text" readonly="true" class="form-control" id="advertLinkInput" placeholder="合同封面" name="contractCover" ng-model="item.contractCover">
        <div  ng-if="item.id&&booleanInsert&&item.contractStatus=='04'" class="btn btn-primary add-pic-btn">合同封面</div>
      </div>
    </div>

    <div class="form-group"  ng-if="item.id&&booleanInsert&&item.contractStatus>='04'">
      <label class="col-sm-2 control-label">合同封面</label>
      <div class="col-sm-5" style="margin-top: 13px;">
        <img ng-src="{{staticHost}}{{item.contractCover}}" />
      </div>
    </div> 

    <div ng-if="item.id&&booleanInsert&&item.contractStatus=='02'" class="form-group">
      <div class="col-sm-offset-2 col-sm-5">
        <button type="button" ng-click="save('03')" class="btn btn-default"  has-auth where="btn">已处理</button>
      </div>
    </div>

    <div ng-if="item.contractStatus=='04'" class="form-group">
      <div class="col-sm-offset-2 col-sm-5">
        <button type="button" ng-click="save('05')" class="btn btn-default"  has-auth where="btn">回收合同</button>
      </div>
    </div>
<!--
    <div ng-if="item.contractStatus>='05'" class="form-group">
      <div class="col-sm-offset-2 col-sm-5">
        <button type="button" disabled="disabled" class="btn btn-default"  where="btn" >申请成功/合同已回收</button>
      </div>
    </div>
-->
  </div>
   
  </form>


</div>
<div load-script src="'/static/jquery.jUploader-1.01.js?5'" call-back="" charset="utf-8" ></div>